<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>作用域插槽</title>
	</head>
	<body>
		<div id="field">
			<field-component>
				<template slot-scope='aaa'>
					<li>{{aaa.item}} - hello</li>
				</template>
			</field-component>
		</div>
		
		<script src="js/vue.js"></script>
		<script>
			
			Vue.component('field-component',{
				data:function(){
					return{
						list:[1,2,3,4]
					}
				},
				template:`<div>
							<ul>
								<slot v-for="item of list" :item=item></slot>
							</ul>
						  </div>`
			})
			
			let vm = new Vue({
				el:'#field'
			})
		</script>
	</body>
</html>
